<template>
  <div class="alert-body" v-if="dialogVisible">
    <div class="alert-box">
      <div class="alert-box-header">
        <span>{{dataOption|| '--'}}（{{teacherList.length}}人）</span>
        <span class="iconfont iconguanbi" @click="closeModle"></span>
      </div>
      <div class="alert-box-body">
        <div class="teacher-content">
          <div class="teacher-content-list" v-for="(item,index) in teacherList" :key="index">
            <div class="teacher-content-list-img">
              <img :src="item.user.pic" alt="">
            </div>
            <span class="teacher-content-list-name overflow-01">{{item.user.realname}}</span>
          </div>
        </div>
      </div>
      <div class="alert-box-footer">
        <span @click="closeModle">返回</span>
      </div>
    </div>

  </div>
</template>
<script>
import {honorDetail} from "@/api/admin/school";

export default {
  name: "foodData",
  props: ['visible', 'dataOption'],
  components: {},
  data() {
    return {
      typeData: 'food_check',
      foodCodeVisible: false,
      dialogVisible: false,
      teacherList: []
    };
  },
  watch: {
    visible() {
      this.dialogVisible = this.visible
      if(this.visible){
        honorDetail({name: this.dataOption}).then(res=>{
          console.log('res++++', res)
          this.teacherList = res.list
        })
      }else{
        this.teacherList = []
      }
    }
  },
  created() {
  },
  mounted() {

  },
  methods: {
    closeModle() {
      this.$emit('update:visible', false)
      this.dialogVisible = false
    },
    confirmFn() {
      this.showTime = false
    },
  }
};
</script>
<style scoped>
.alert-body {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, .7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-box {
  width: 85%;
  height: 80%;
  border: 1px solid #005da6;
  background: rgba(13, 17, 44, .8);
  display: flex;
  flex-direction: column;
  border-radius: 10px;
}

.alert-box-header {
  height: 60px;
  display: flex;
  color: #beebfe;
  font-size: 26px;
  padding: 0 20px;
  line-height: 60px;
}

.alert-box-header .iconfont {
  font-size: 26px;
  cursor: pointer;
  margin-left: 20px;
  padding: 0 10px;
}

.alert-box-header span:first-child {
  flex: 1;
}

.alert-box-footer {
  height: 60px;
}

.alert-box-body {
  flex: 1;
  padding: 0 10px;
  overflow-y: auto;
}


.alert-box-list-in i {
  color: #02d5ff;
  font-style: normal;
  font-size: 20px;
  font-weight: bold;
}

.alert-box-list-in em {
  font-style: normal;
}

.alert-box-footer {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.alert-box-footer span {
  display: block;
  border: 1px solid #beebfe;
  color: #beebfe;
  width: 120px;
  height: 40px;
  line-height: 40px;
  font-size: 20px;
  border-radius: 3px;
  cursor: pointer;
}

.alert-box-footer span:first-child {
  margin-right: 20px;
}

.alert-box-footer span:hover {
  background: rgba(0, 73, 85, 0.6);

}

.teacher-content-list{
  float: left;
  background: rgba(255,255,255,.2);
  padding: 10px;
  border-radius: 10px;
  margin-right: 15px;
  margin-bottom: 15px;
  box-shadow: 0 0 2px #000;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.teacher-content-list-img{
  width: 195px;
  height: 250px;
  margin-bottom: 20px;
  border-radius: 5px;
}
.teacher-content-list-img img{
  width: 195px;
  height: 250px;
  display: block;
  border-radius: 5px;
}
.teacher-content-list-name{
  text-align: center;
  font-size: 22px;
  display: block;
  color: #fff;
  font-weight: bold;
  width: 166px;
}
.overflow-01{
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.teacher-content-list:hover{
  box-shadow: 0 1px 8px #7c5d00;
}
</style>
